<?php
/**
 * common repository file Created by PhpStorm.
 * User: wumengmeng
 * Date: 2020/05/20
 * Time: 14:22
 */
 
 namespace HiCommon\Repository;

//use HiCommon\Model\AppDownload;

use SimpleSoftwareIO\QrCode\Facades\QrCode;

class AppDownloadRepository extends BaseRepository
{
    public function base_model(){
        return new \HiCommon\Model\AppDownload();
    }

    public function app_new_version_list(){
        $arr_data = [];
        $res = self::base_model()->where(['type'=>1])->orderBy('id','desc')->first();
        if(!is_null($res)){
            $arr_data[] = $res->toarray();
        }
        $res = self::base_model()->where(['type'=>2])->orderBy('id','desc')->first();
        if(!is_null($res)){
            $arr_data[] = $res->toarray();
        }
        $res = self::base_model()->where(['type'=>3])->orderBy('id','desc')->first();
        if(!is_null($res)){
            $arr_data[] = $res->toarray();
        }
        $res = self::base_model()->where(['type'=>4])->orderBy('id','desc')->first();
        if(!is_null($res)){
            $arr_data[] = $res->toarray();
        }
        return $arr_data;
    }

}